program Project1;

{$APPTYPE CONSOLE}
{$R+,Q+,S+}

uses
  SysUtils,
  Math;

type rect = record
  a,b,p1,p2 : extended;
end;

type event = record
  x : extended; n : integer; op : boolean;
end;

var a : array [1..200000] of event;
    n,m,i,j,k : integer;
    k1,k2,k3,k4 : extended;
    a1,a2 : extended;

procedure sort(l,r: integer);
  function less(a,b : event) : boolean;
  begin
    if a.x <> b.x then
      less := a.x < b.x
    else
      less := not a.op and b.op;
  end;

var i,j: integer;
x,y : event;
begin
  i := l;
  j := r;
  x := A[ (l + r) div 2 ];
  repeat
    while less(A[i], x) do inc(i);
    while less(x, A[j]) do dec(j);
    if not (i>j) then
      begin
        y    := A[i];
        A[i] := A[j];
        A[j] := y;
        inc(i);
        dec(j);
      end;
  until i>j;
  if l < j then sort(l,j);
  if i < r then sort(i,r);
end;

function _mod(a,b : integer) : integer;
begin
  if a mod b <> 0 then _mod := a mod b else _mod := b;
end;

function diff(a,b : extended) : extended;
begin
  if a >= b then diff := a-b else
    diff := a-b+2*pi;
end;

var f : integer;
    u : array [1..100000] of boolean;
    b,bb : integer;
    ans : extended;

begin
  read(n);
  a1 := -1e100;
  a2 := +1e100;
  for i := 1 to n do
    begin
      read(k1,k2,k3,k4);
      if k1 > a1 then a1 := k1;
      if k2 < a2 then a2 := k2;
      a[2*i-1].x := k3;
      a[2*i-1].op := true;
      a[2*i-1].n := i;
      a[2*i].x := k4;
      a[2*i].op := false;
      a[2*i].n := i;
    end;
  if a1 > a2 then begin writeln(0); halt; end;
  sort(1,2*n);
  fillchar(u, sizeof(u), 0);
  f := 1;
  while not a[f].op do inc(f);
  bb := 0;
  i := _mod(f+1, 2*n);
  //while a[i].n <> a[f].n do
  u[a[f].n] := true;
  while i <> f do
    begin
      if a[i].op then
        u[a[i].n] := true
      else
        if not u[a[i].n] then
          inc(bb);
      i := _mod(i+1, 2*n);
    end;
  i := _mod(f+1, 2*n);
  b := 1+bb;
  ans := 0;
  while i <> f do
    begin
      if a[i].op then inc(b) else
        begin
          if b = n then
            ans := ans + diff(a[i].x, a[_mod(i-1,2*n)].x);
          dec(b);
        end;
      i := _mod(i+1, 2*n);
    end;
  writeln(ans*(a2*a2 - a1*a1)/2);
end.

